package cn.dlc.com.mapper;

import cn.dlc.com.pojo.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysRoleMapper extends BaseMapper<SysRole> {

    // 根据用户名获取角色列表
    @Select("select sr.id as id, sr.ROLE_NAME as roleName, sr.ROLE_DESC as roleDesc " +
            "from sys_role sr, sys_user_role sur " +
            "where sr.id = sur.RID and sur.uid = #{uid}")
    List<SysRole> findByUserId(Integer uid);
}
